#pragma once
//============================================================================
// Copyright (C) 2013 Brett R. Jones
//
// Issued to public domain 2013
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#include "VxTextStreamReader.h"
#include "VxBuffer.h"

class VxHttpParse : public VxTextStreamReader 
{

	//=== vars ===//
	VxBuffer	m_oContentsBuffer;

public:
	//=== constants ===//


	//=== constructor ===//
	VxHttpParse();
	virtual ~VxHttpParse();


	//=== methods ===//
	VxBuffer&				getContentsBuffer( void );

	virtual bool			parseHttpHeaderFromContents();

	virtual const char *	getHttpValue( const char *name, std::string& strRetValue );

	virtual const char *	getHost( std::string& strRetValue );
	virtual const char *	getServer( std::string& strRetValue );
	virtual const char *	getLocation( std::string& strRetValue );
	virtual const char *	getCacheControl( std::string& strRetValue );
	virtual int				getHttpContentLen();
	virtual int				getHttpCodeNumber( void );
	std::string				getMethod( void );
	bool					isHttp( void );
	std::string				readUntil( char const*& str, char delim, char const* end );
};

